<?php include './include/conf.php';
	
	
	$requete = $pdo->prepare("select * from adherent where id_adherent in (select id_adherent from louer where id_parcelle=?)");
	$requete->execute(array($_GET['id']));
	$user = $requete->fetch();
	
	$requete2 = $pdo->prepare("select nom from champ where id_champ in(select id_champ from anonymat where id_adherent=? and visible=?)");
	$requete2->execute(array($user->id_adherent,1));
	
	
	$res = "";
	$res.= $user->prenom ;
	$res.= " ".$user->nom."\n";
	
	//On ajoute les informations que l'adherent veut rendre publiques
	while($ligne = $requete2->fetch())
	{
		$nomchamp = $ligne->nom;
		$res .= $user->$nomchamp."\r\n";
	}
	echo $res;
	
?>